import { defineStore } from 'pinia'
export const settingStore = defineStore('setting', {
    persist: {
        enabled: true
    },
    state: () => {
        return {
            // 皮肤
            theme: {
                key: 'light-dark',
                name: '深色+浅色'
            }
        }
    },
    actions: {
        /**
         * 修改当前state的值
         */
        setSettingStore({ key, value }) {
            if (key && value) {
                this[key] = value
            } else {
                return false
            }
        }
    },
    getters: {
        /**
         * 获取当前state的值
         */
        getSettingStore(stateValue) {
            if (stateValue) {
                return this[stateValue]
            } else {
                return false
            }
        }
    }
})
